
import request from '@/utils/request'

/**
 * 奖励列表
 * @param {
 * type:1:普通奖励配置 2:限定奖励配置
 * is_next: 0:本期奖池 1:下期奖池
 * level； 1初2中3高级
 * page=1&perPage=20
 * } query 
 * @returns 
 */
export function rechargeRewardList(query) {
    return request({
        url: '/admin/recharge/reward/list',
        method: 'get',
        params: query
    })
}

/**
 * 新增奖励/编辑奖励
 * @param {
 * type:1:普通奖励配置 2:限定奖励配置
  * is_next: 0:本期奖池 1:下期奖池
 * level； 1初2中3高级
 * reward_type: 礼物=gift 商品=product
 * reward_id:奖品id
 * number: 数量/权重
 * count: 商品的有效期天数
 * } query 
 * @returns 
 */
export function rechargeRewardAdd(query) {
    return request({
        url: '/admin/recharge/reward/add',
        method: 'post',
        data: query
    })
}
export function rechargeRewardEdit(query) {
    return request({
        url: '/admin/recharge/reward/edit',
        method: 'post',
        data: query
    })
}

/***
 * 删除奖励
 * @param {
 * type:1:普通奖励配置 2:限定奖励配置
 * is_next: 0:本期奖池 1:下期奖池
 * page=1&perPage=20
 * } query 
 * @returns 
 */
export function rechargeRewardDel(query) {
    return request({
        url: '/admin/recharge/reward/del',
        method: 'post',
        data: query
    })
}

/**
 * 批量修改权重 
 * @param {
 * type:1:普通奖励配置 2:限定奖励配置
 * is_next: 0:本期奖池 1:下期奖池
 * ids:
 * number: 权重/数量
 * } query 
 * @returns 
 */
// 
export function rechargeRewardBatch(query) {
    return request({
        url: '/admin/recharge/reward/batch',
        method: 'post',
        data: query
    })
}

// 替换新奖池 type:1:普通奖励配置 2:限定奖励配置
export function rechargeRewardReplace(query) {
    return request({
        url: '/admin/recharge/reward/replace',
        method: 'post',
        data: query
    })
}

// 中奖记录 
export function rechargeRewardLog(query) {
    return request({
        url: '/admin/recharge/reward/log',
        method: 'get',
        params: query
    })
}

/**
 * 
 * 提示设置
 * 
 */
// 列表
export function rechargeNoticeList(query) {
    return request({
        url: '/admin/recharge/notice/list',
        method: 'get',
        params: query
    })
}
// 新增
export function rechargeNoticeAdd(query) {
    return request({
        url: '/admin/recharge/notice/add',
        method: 'post',
        data: query
    })
}
// 编辑
export function rechargeNoticeEdit(query) {
    return request({
        url: '/admin/recharge/notice/edit',
        method: 'post',
        data: query
    })
}
// 批量编辑
export function rechargeNoticeBatch(query) {
    return request({
        url: '/admin/recharge/notice/batch',
        method: 'post',
        data: query
    })
}
// 修改状态
export function rechargeNoticeStatus(query) {
    return request({
        url: '/admin/recharge/notice/status',
        method: 'post',
        data: query
    })
}
// 删除
export function rechargeNoticeDel(query) {
    return request({
        url: '/admin/recharge/notice/del',
        method: 'post',
        data: query
    })
}

/**
 * 
 * 活动设置
 * 
 */
// 活动设置列表
export function rechargeSettingList(query) {
    return request({
        url: '/admin/recharge/setting/list',
        method: 'get',
        params: query
    })
}
// 保存
export function rechargeSettingSave(query) {
    return request({
        url: '/admin/recharge/setting/save',
        method: 'post',
        data: query
    })
}
// 统计
export function rechargeOpenTotal(query) {
    return request({
        url: '/admin/recharge/open/total',
        method: 'get',
        params: query
    })
}